package scraper

import (
	"context"
	"database/sql"

	"github.com/prometheus/client_golang/prometheus"
	"go.uber.org/zap"
)

// Specify constants such as namespaces.
const (
	Exporter  = "exporter"
	Namespace = "kingbase"
)

// Scraper is minimal interface that let's you add new prometheus metrics to kingbase_exporter.
type Scraper interface {
	// Name of the Scraper. Should be unique.
	Name() string

	// Help describes the role of the Scraper, specific for cli.
	Usage() string
}

type DBScraper interface {
	Scraper

	// Scrape collects data from database connection and sends it over channel as prometheus metric.
	Scraper(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric, logger *zap.Logger) error
}
